<?php

namespace app\exam\validate;

use think\Validate;

/**
 * 试题收藏验证
 */
class TopicCollect extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'    =>    ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'topic_id'      => 'require|/^[\d,]+$/',
        'status'        => 'require|in:0,1'
    ];

    protected $field = [
        'topic_id'      => '试题',
        'status'     	=> '收藏',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'    =>    '错误信息'
     * @var array
     */
    protected $message = [
        'topic_id.number'       => '参数错误',
        'status.in'             => '参数错误',
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'collect'     	=> ['topic_id', 'status'],
    ];


}
